<template>
<h1>{{name1}}</h1><br>
<h1>{{name}}</h1><br>
<h1>{{gender}}</h1>
<button @click="updata"></button>
</template>

<script setup lang="ts">
import {ref,reactive,toRef,toRefs,watch} from 'vue'
let name1 = ref('李四')
let obj = reactive({name:'张三', age:18, gender:'男'})

let {name,gender} = toRefs(obj)
const updata = ()=>{
   name.value = '我是改变'
}

</script>

<style scoped>

</style>
